<?php

Route::get('/',['uses'=>'IndexControllers@index']);
Route::get('/login',['as'=>'login','uses'=>'IndexControllers@login']);
Route::get('/user/center',['as'=>'user','uses'=>'IndexControllers@user']);


//管理后台 
Route::group(['domain' => env('ADMIN_DOMAIN'),'namespace' => 'Manage'], function () {

    Route::get('/admin/login', 'AdminController@login')->name('manage_login');
    Route::post('/admin/login', 'AdminController@PostLogin')->name('manage_login_post');
    Route::get('/get/captcha', 'AdminController@getCaptcha')->name('get_captcha');

    //登录 继承manage中间件
    Route::group(['middleware'=>['manage'] , 'prefix' => 'manage'], function () {

        Route::get('/', 'AdminController@index')->name('manage_index');
        Route::get('/admin/loginout', 'AdminController@loginOut')->name('manage_login_out');
        //菜单
        Route::get('/menu/list', ['as' => 'menu_list', 'uses' => 'MenuController@menuList']);
        Route::get('/menu/add', ['as' => 'menu_add', 'uses' => 'MenuController@menuAdd']);
        Route::post('/menu/add', ['as' => 'menu_add_post', 'uses' => 'MenuController@menuPostAdd']);
        Route::get('/menu/edit', ['as' => 'menu_edit', 'uses' => 'MenuController@menuEdit']);
        Route::post('/menu/edit', ['as' => 'menu_edit_post', 'uses' => 'MenuController@menuPostEdit']);
        Route::get('/menu/module/list', ['as' => 'menu_module_list', 'uses' => 'MenuController@menuModuleList']);
        Route::post('/menu/module/add', ['as' => 'menu_module_add_post', 'uses' => 'MenuController@modulePostAdd']);
        Route::get('/menu/module/edit', ['as' => 'menu_module_edit', 'uses' => 'MenuController@moduleEdit']);
        Route::post('/menu/module/edit',
            ['as' => 'menu_module_edit_post', 'uses' => 'MenuController@modulePostEdit']);
        Route::get('/first/menu/list', ['as' => 'first_menu_list', 'uses' => 'MenuController@firstMenuList']);
        Route::get('/first/menu/add', ['as' => 'first_menu_add', 'uses' => 'MenuController@firstMenuAdd']);
        Route::post('/first/menu/add', ['as' => 'first_menu_add_post', 'uses' => 'MenuController@firstMenuPostAdd']);
        Route::get('/first/menu/edit', ['as' => 'first_menu_edit', 'uses' => 'MenuController@firstMenuEdit']);
        Route::post('/first/menu/edit', ['as' => 'first_menu_edit_post', 'uses' => 'MenuController@firstMenuPostEdit']);
        //角色
        Route::get('/role/list', ['as' => 'role_list', 'uses' => 'RoleController@roleList']);
        Route::get('/role/add', ['as' => 'role_add', 'uses' => 'RoleController@roleAdd']);
        Route::post('/role/add', ['as' => 'role_add_post', 'uses' => 'RoleController@rolePostAdd']);
        Route::get('/role/edit', ['as' => 'role_edit', 'uses' => 'RoleController@roleEdit']);
        Route::post('/role/edit', ['as' => 'role_edit_post', 'uses' => 'RoleController@rolePostEdit']);
        Route::get('/role/power/list', ['as' => 'role_power_list', 'uses' => 'RoleController@powerList']);
        Route::post('/role/power/add', ['as' => 'role_power_add_post', 'uses' => 'RoleController@powerPostAdd']);
        //后台用户
        Route::get('/user/list', ['as' => 'user_list', 'uses' => 'UserController@userList']);
        Route::get('/user/role/add', ['as' => 'user_role_add', 'uses' => 'UserController@userRoleAdd']);
        Route::post('/user/role/add', ['as' => 'user_role_add_post', 'uses' => 'UserController@userRolePostAdd']);
        Route::get('/user/add', ['as' => 'user_add', 'uses' => 'UserController@userAdd']);
        Route::post('/user/add', ['as' => 'user_add_post', 'uses' => 'UserController@userPostAdd']);
        Route::get('/user/edit', ['as' => 'user_edit', 'uses' => 'UserController@userEdit']);
        Route::post('/user/edit/post', ['as' => 'user_edit_post', 'uses' => 'UserController@userPostEdit']);

    });

});